﻿using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using Zeus.Events;
using Zeus.Classes.Events;
using Zeus.CompilationService;

namespace Zeus.UserControls
{
    public partial class ErrorListUserControl : UserControl
    {
        public ErrorListUserControl()
        {
            InitializeComponent();
            App.EventAggegator.GetEvent<ErrorList>().Subscribe(ChangeState);
            App.EventAggegator.GetEvent<FillErrorList>().Subscribe(FillList);
        }

        public void FillList(List<ErrorItem> List)
        {
            errors.ItemsSource = List;
            ErrorListAccordion.Visibility = Visibility.Visible;
        }
        public void ChangeState(object o)
        {
            ErrorListAccordion.Visibility = Visibility.Visible;
        }
    }
}

